package com.company.cloud.company.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.company.modules.api.service.CompanyCheckRemoteService;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

@Log4j2
@Component
public class CompanyCheckRemoteServiceFallbackFactory  implements FallbackFactory<CompanyCheckRemoteService> {
    @Override
    public CompanyCheckRemoteService create(Throwable cause) {
        return new CompanyCheckRemoteService() {
            @Override
            public BaseClientResult<String> checkCompany(String companyNo) {
                return BaseClientResult.callbackError();
            }
        };
    }
}
